//
//  GYSettingCell.m
//  01-城觅
//
//  Created by xiaomage on 16/8/17.
//  Copyright © 2016年 小码哥. All rights reserved.
//

#import "GYSettingCell.h"
#import "GYSettingRowItem.h"


@implementation GYSettingCell


+ (instancetype)cellWithTableView:(UITableView *)tableView style:(UITableViewCellStyle)style{
    
    
    static NSString *ID = @"settingCell";
    
    GYSettingCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[GYSettingCell alloc] initWithStyle:style reuseIdentifier:ID];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    }
    
    return cell;
    
}

- (void)setRowItem:(GYSettingRowItem *)rowItem {
    _rowItem = rowItem;
    
    //1.设置数据
    [self setUpData:rowItem];
     
}

//设置数据
- (void)setUpData:(GYSettingRowItem *)rowItem {
    
    //设置数据
    self.imageView.image = rowItem.image;
    self.textLabel.text = rowItem.title;
    self.detailTextLabel.text = rowItem.subTitle;
    
    if ([self.textLabel.text  isEqual: @"账户余额"]) {
        self.detailTextLabel.textColor = [UIColor orangeColor];
    }
    
}





@end
